<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0,user-scalable=no">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>{$juanzhu_xuesheng.xuesheng_name}_{$shop_name}</title>
    <meta name="Keywords" content="{$keywords}" />
    <meta name="Description" content="{$description}" />
    <link rel="stylesheet" href="/mobiles/css/base.css?v={$time}">
    <link rel="stylesheet" href="/mobiles/css/common.css?v={$time}">
    <link rel="stylesheet" href="/mobiles/css/style.css?v={$time}">
    <link rel="stylesheet" href="/mobiles/css/nav_iphone.css?v={$time}">
    <link rel="stylesheet" href="/mobiles/css/tab.css?v={$time}">
    <link rel="stylesheet" href="/mobiles/css/layui.css?v={$time}">
    <script src="/mobiles/js/jquery-1.11.2.min.js?v={$time}"></script>
    <script src="//res.wx.qq.com/open/js/jweixin-1.2.0.js"></script>
</head>

<body>
    <!-- #BeginLibraryItem "/library/page_headers.lbi" --><!-- #EndLibraryItem -->
    <div class="iphone_con">
        <div class="z_banner"><img src="/mobiles/images/z_banner1.jpg" alt=""></div>
        <div class="z_wrap">
            
            <div class="w_title"><h3>{$juanzhu_xuesheng.xuesheng_name}</h3></div>
            <div class="thjj" style="font-size:16px; color:#666;line-height:30px;">
          <!--------------------------------------------->
          <p style="text-align:center;">

<p><strong>具体详情：</strong></p>
<p style="text-align:center;">
<form action="zizhu_xuesheng_juanzhu.php" class="layui-form" name="user_Form" method="post" onsubmit="return checkjuanzhuinfo()">
<table width="100%" border="0" cellspacing="0" cellpadding="0">
  <tr>
    <td>
    <table class="list-divyt" cellspacing='1' cellpadding='3' style="width:100%">
    <tr><td class="first-cell">学生姓名</td><td style="text-align:left"><span>{$juanzhu_xuesheng.xuesheng_name}</span></td></tr>
    <tr><td class="first-cell">申请金额</td><td style="text-align:left">{$juanzhu_xuesheng.xuesheng_jine}元&nbsp;[此金额含8%管理费]</td></tr>
    <tr><td class="first-cell">还需捐助</td><td style="text-align:left">{$juanzhu_xuesheng.xuzizhu}元</td></tr>
    <tr>
      <td class="first-cell">我要捐助</td><td style="text-align:left"><input type="number" class="layui-input" id="juanzhu_price" name="juanzhu_price" placeholder="请输入捐助金额" value="{$juanzhu_xuesheng.input_xuzizhu}" style="border:1px solid #cccccc;height:30px;width:80px;line-height:30px; margin:10px auto;">&nbsp;&nbsp;元</td>
    </tr>
    <tr><td class="first-cell">捐助留言</td><td style="text-align:left"><input type="text" class="layui-input" id="content" name="content" placeholder="请输入捐助留言"></td></tr>
     <tr>
       <td colspan="2" class="lay-zizhu" height="50" style="line-height:50px;"><button class="layui-btn" lay-sumbit onClick="return userApply()" OnClientClick="javascript:callpay();return false;">确认支付</button>
      <input type="hidden" name="action" value="juanzhu">
      <input type="hidden" name="id" value="{$juanzhu_xuesheng.id}"></td>
     </tr>
</table></td>
    </tr>
</table>
</form></p></p></div></div></div>
<!-- #BeginLibraryItem "/library/page_footer.lbi" --><!-- #EndLibraryItem -->
{$pay_button}
    
    <script>
    document.addEventListener('DOMContentLoaded', function() {
  var inputBox = document.getElementById('juanzhu_price');
  inputBox.focus(); // 让input框获得焦点，即默认被选中
  inputBox.setSelectionRange(inputBox.value.length, inputBox.value.length);
});

		function checkjuanzhuinfo(){
			var re = /^\d+00$/;
			var inputstr = $("input[name='juanzhu_price']").val();
			var xuzizhu = '{$juanzhu_xuesheng.xuzizhu}';
			xuzizhu = parseInt(xuzizhu);
			inputstr = parseInt(inputstr);
			if(inputstr>xuzizhu){
				alert("输入金额不能超过需资助金额");
				$("input[name='juanzhu_price']").focus();
				return false;
			}
			if(inputstr<100&&xuzizhu>=100){
				alert("最低资助金额100元");
				$("input[name='juanzhu_price']").focus();
				return false;
			}
			if(xuzizhu<100){
				if(inputstr!=xuzizhu){
				  alert("当还需捐助金额小于100时,需要全部资助");
				  $("input[name='juanzhu_price']").val(xuzizhu);
				  return false;
				}
			}
			return true;
	    }
   </script>
</body>
</html>